package ran.friend.controller.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ran.api.domain.vo.UserQuestionResultVO;
import ran.controller.BaseController;
import ran.entity.Result;
import ran.friend.domain.user.dto.UserSubmitDTO;
import ran.friend.service.user.IUserQuestionService;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ran
 * Date: 2025-11-21
 * Time: 22:11
 */
@RestController
@RequestMapping("/user/question")
public class UserQuestionController extends BaseController {
    @Autowired
    private IUserQuestionService userQuestionService;

    @PostMapping("/submit")
    public Result<UserQuestionResultVO> submit(@RequestBody UserSubmitDTO userSubmitDTO) {
        return userQuestionService.submit(userSubmitDTO);
    }
    @PostMapping("/rabbitmq/submit")
    public Result<Void> rabbitmqSubmit(@RequestBody UserSubmitDTO userSubmitDTO) {
        return toResult(userQuestionService.rabbitmqSubmit(userSubmitDTO));
    }
}
